import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Controls.impl 2.12

CheckBox {
    id: root
    height: font.pointSize*2
    text: qsTr("CheckBox")
    property color checkedColor: "#0ACF97"
    property real textSize: 15

    contentItem: CheckLabel {
        text: root.text
        font.pointSize: textSize
        font.family: "仿宋"
        font.bold: true
        color: checkedColor
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        renderType: Text.NativeRendering
        elide: Text.ElideRight
        leftPadding: root.indicator.width + root.leftPadding
//        rightPadding: root.rightPadding
    }


    indicator: Rectangle {
        x: root.leftPadding
        anchors.verticalCenter: parent.verticalCenter
        width: textSize*1.8;
        height: width
        antialiasing: true
        radius: height/5
        border.width: radius/3
        border.color: root.checkedColor

        Rectangle {
            anchors.centerIn: parent
            width: parent.width*0.7; height: width
            antialiasing: true
            radius: parent.radius * 0.7
            color: root.checkedColor
            visible: root.checked
        }
    }
}

/*##^##
Designer {
    D{i:0;formeditorZoom:1.5}
}
##^##*/
